import 'package:find_friend/const/const.dart';
import 'package:find_friend/pages/login&register/model/shared_user_info.dart';
import 'package:flutter/material.dart';

class MineSexWidget extends StatelessWidget {

  final SharedUserInfo userInfo;

  const MineSexWidget({Key key, this.userInfo}) : super(key: key);

  Widget _wuxingImage(int index) {
    if(userInfo?.wuxing == null) return SizedBox();
    const Map<String, String> map = {"金":"jin.png","木":"mu.png","水":"shui.png","火":"huo.png","土":"tu.png"};
    final arr = userInfo?.wuxing?.split("");
    return Image.asset("assets/${map[arr[index]]}");
  }
  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
      Image.asset(userInfo?.gender == 1 ? "assets/nan.png" : "assets/nv.png"),
      SizedBox(width: 3,),
      Text(userInfo?.zodiac ?? "天蝎座", style: instanceTextStyle(11, APP_main_color),),
      SizedBox(width: 3,),
      _wuxingImage(0),
      SizedBox(width: 3,),
      _wuxingImage(1),
    ]);
  }
}